class Router {
	constructor(app, dom) {
		const Vue = require('vue');
		const VueRouter = require('vue-router');
		Vue.use(VueRouter);
		this.router = new VueRouter();
		this.app = app;
		this.dom = dom;
	};
	map(){
		//路由
		this.router.map({
		    '/news': {
		      component: require('./components/news.vue')
		    },
		    '/about': {
		      component: require('./components/about.vue')
		    },
		    '*': {
		    	component: require('./components/index.vue') //其它所有页面加载首页
		    }
		});
	};
	start(){
		this.map();
		this.router.start(this.app, this.dom);
	}
}

export default Router;